<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title></title>
<link rel="stylesheet" type="text/css" href="../../css/index.css" />
<style media="screen">

	html,body{width: 100%;height: 100%;background:#FF9502;}
	input::-webkit-input-placeholder{color: #BBBBBB;font-size: 14px;}
	input::-moz-placeholder{color: #BBBBBB;font-size: 14px;}
	.warp{width: 100%;height: 100%;background: url(../../image/main3/h5.png) no-repeat top center;background-size: 100% auto;}
	.bg-box{width: 100%;height: 218px;}
	.bg-box .guize{text-align: right;box-sizing: border-box;font-size: 15px;color: #ffffff;line-height: 30px;padding: 10px 15px;}
	.bg-box .title{text-align: center;color:#ffffff;font-size: 18px;font-weight:bold;box-sizing:border-box;padding-top: 40px;}

	.top-img{height: 10px;background: url(../../image/main3/h5_2.png) no-repeat top center;background-size: 100% auto;margin:32% 15px 0 15px;}
	.info-box{box-sizing: border-box;margin:0 15px;background: #ffffff;padding: 40px 30px;box-sizing: border-box;border-radius: 4px;}
	.info-box .t3{font-size: 15px;}
	.info-one{align-items:center;flex-shrink: 0;margin-bottom: 10px;overflow: hidden;width: 100%;background: #F4F4F4;border-radius: 4px;padding: 0 15px;box-sizing: border-box;}
	.info-one input{padding: 10px 0;box-sizing: border-box;line-height: 30px;width: 100%;color: #333333;}
	.info-one .code{width: auto;height: 28px;background:#F4F4F4;text-align: center;line-height: 28px;font-size: 12px;color: #FF9502;flex-shrink: 0;}
	.login-btn{width: 100%;height:44px;flex-shrink: 0;background:#FF9502;border-radius:4px;text-align: center;line-height: 44px;color: #FFFFFF;font-size: 14px;margin-top: 30px;}

</style>
</head>
<body>
	<div id="vue" class="warp">
		<div class="bg-box">
			<div class="guize">邀请规则</div>
			<div class="title">用户13923454567</div>
		</div>
		<div class="top-img"></div>
		<div class="info-box">
			<div class="info-one flex">
				<div class="flex1">
					<input type="tel" maxlength="11" name="phone" id="phone" placeholder="请输入手机号">
				</div>
			</div>
			<div class="info-one flex">
				<div class="flex1">
					<input type="tel" name="code" id="code" placeholder="请输入验证码">
				</div>
				<div class="code" tapmode onclick="getCodeClick(this)">获取验证码</div>
			</div>
			<div class="login-btn" tapmode onclick="upData()">立即注册</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-js="L/swiper.min,L/lazyload,L/h-tool"></script>
<script type="text/javascript">
	var data = {};
	define(function (require, exports, module) {

		lanYun.newVue('#vue',{
		},function() {

		});

		// 注册
		upData = function (){
			data.phone = $('#phone').val();
			data.code = $('#code').val();
			if(!data.code) {
				lanYun.toast('请输入短信验证码');
				return;
			}
			//console.log(JSON.stringify(data));
			lanYun.post('user/editPhone', data ,function (ret) {
				//console.log(JSON.stringify(ret));
	            if(ret.errcode == 0){
					lanYun.toast('修改成功');
					lanYun.setStorage('reshpage',1);
					lanYun.updateUdata(ret.data, 1);
					clearTimeout(lanYun.timeout);
					api.closeWin()
	            }else {
	            	lanYun.toast(ret.msg);
	            }
	        });
		}

		//获取验证码
		getCodeClick = function (tis) {
			if($(tis).hasClass('on')){
				return;
			}
			var data = {type : 'reg'};
			data.phone = $('#phone').val();
			if(!TOOL.check.isMobile(data.phone)){
				lanYun.toast('请输入正确的手机号');
				return;
			}
			lanYun.setWait(tis);
			//console.log(JSON.stringify(data));
			lanYun.post('send/getcode', data ,function (ret) {
				//console.log(JSON.stringify(ret));
				if(ret.errcode == 0){
					lanYun.toast(ret.msg);
					lanYun.setWait(tis);
				}else{
					lanYun.toast(ret.msg);
				}
			});
		};

	});

</script>
</html>
